// 项目页面路由
const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/layout',
    name: 'layout',
    component: () => import('../views/layout/layout'),
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: '首页',
        component: () => import('../views/home/home')
      },
      {
        path: '/brands',
        name: '品牌馆',
        component: () => import('../views/brands/brands')
      },
      {
        path: '/analysisData',
        name: '中老期茶叶数据',
        meta: { auth: true },
        component: () => import('../views/competitorData/analysisData')
      },
      {
        path: '/jdTeaData',
        name: '京东平台数据',
        meta: { auth: true },
        component: () => import('../views/competitorData/jdTeaData')
      },
      {
        path: '/chawoTeaData',
        name: '零售平台数据',
        meta: { auth: true },
        component: () => import('../views/competitorData/chawoTeaData')
      },
      {
        path: '/activity',
        name: '活动',
        component: () => import('../views/activity/activity')
      },
      {
        path: '/user',
        redirect: '/user/order',
        name: '个人中心',
        meta: { auth: true },
        component: () => import('../views/userCenter/user'),
        children: [
          {
            path: '/user/order',
            name: '我的订单',
            meta: { auth: true },
            component: () => import('../views/userCenter/order')
          },
          {
            path: '/user/coupons',
            name: '我的优惠券',
            meta: { auth: true },
            component: () => import('../views/userCenter/coupons')
          },
          {
            path: '/user/account',
            name: '账号管理',
            meta: { auth: true },
            component: () => import('../views/userCenter/account')
          },
          {
            path: '/user/message',
            name: '消息管理',
            meta: { auth: true },
            component: () => import('../views/userCenter/message')
          },
          {
            path: '/user/favoriteGoods',
            name: '收藏的商品',
            meta: { auth: true },
            component: () => import('../views/userCenter/favoriteGoods')
          },
          {
            path: '/user/favoriteStores',
            name: '关注的店铺',
            meta: { auth: true },
            component: () => import('../views/userCenter/favoriteStores')
          },
          {
            path: '/user/address',
            name: '地址管理',
            meta: { auth: true },
            component: () => import('../views/userCenter/address')
          },
          {
            path: '/user/record',
            name: '领样记录',
            meta: { auth: true },
            component: () => import('../views/userCenter/record')
          },
          {
            path: '/user/bill',
            name: '开票中心',
            meta: { auth: true },
            component: () => import('../views/userCenter/bill')
          },
          {
            path: '/user/afterSales',
            name: '售后管理1',
            meta: { auth: true },
            component: () => import('../views/userCenter/afterSales')
          }
        ]
      },
      {
        path: '/user/afterSalesDetail',
        name: '售后详情',
        meta: { auth: true },
        component: () => import('../views/userCenter/afterSalesDetail')
      },
      {
        path: '/user/applyAfterSales',
        name: '售后管理2',
        meta: { auth: true },
        component: () => import('../views/userCenter/applyAfterSales')
      },
      {
        path: '/user/orderSaleAfter',
        name: '申请售后',
        meta: { auth: true },
        component: () => import('../views/userCenter/orderSaleAfter')
      },
      {
        path: '/user/setInfo',
        name: '完善资料',
        meta: { auth: true },
        component: () => import('../views/userCenter/setInfo')
      },
      {
        path: '/order/shopcart',
        name: '采购单',
        meta: { auth: true },
        component: () => import('../views/order/shopcart')
      },
      {
        path: '/order/confirmOrder',
        name: '订单核算',
        meta: { auth: true },
        component: () => import('../views/order/confirmOrder')
      },
      {
        path: '/order/orderInfo',
        name: '订单详情',
        meta: { auth: true },
        component: () => import('../views/order/orderInfo')
      },
      {
        path: '/order/logistics',
        name: '查看物流',
        meta: { auth: true },
        component: () => import('../views/order/logistics')
      },
      {
        path: '/goods/goodsList',
        name: '商品列表',
        component: () => import('../views/goods/goodsList')
      },
      {
        path: '/goods/goodsDetail',
        name: '商品详情',
        component: () => import('../views/goods/goodsDetail')
      },
      {
        path: '/store/storeInfo',
        name: '店铺详情',
        component: () => import('../views/store/storeInfo')
      },
      {
        path: '/news/newsList',
        name: '新闻列表',
        component: () => import('../views/news/newsList')
      },
      {
        path: '/news/newsDetail',
        name: '新闻详情',
        component: () => import('../views/news/newsDetail')
      }
    ]
  },
  {
    path: '/signLayout',
    name: '登录/注册layout',
    component: () => import('../views/layout/signLayout'),
    redirect: '/login',
    children: [
      {
        path: '/login',
        name: '登录',
        component: () => import('../views/login/login')
      },
      {
        path: '/login/passwordReset',
        name: '忘记密码',
        component: () => import('../views/login/passwordReset')
      },
      {
        path: '/signup',
        name: '注册',
        component: () => import('../views/signup/signup')
      },
      {
        path: '/order/payment',
        name: '订单支付',
        meta: { auth: true },
        component: () => import('../views/order/payment')
      },
      {
        path: '/wechatPay',
        name: '微信支付',
        meta: { auth: true },
        component: () => import('../views/order/wechatPay')
      },
      {
        path: '/order/paymentResult',
        name: '支付结果',
        meta: { auth: true },
        component: () => import('../views/order/paymentResult')
      }
    ]
  },
  {
    path: '*',
    name: '非法路由',
    redirect: '/error',
    component: () => import('../views/error/404')
  },
  {
    path: '/error',
    name: '404页面',
    component: () => import('../views/error/404')
  }
]

export default routes
